<?php

session_start();

require_once "../conn.php";

if(!isset($uname) && !isset($upass)) {
  ?>
  <html>
  <head>
  <title> Jobseekers Login  </title><meta dcb license 123456789>
  <style>
.LN { padding-top:5}

input, select, textarea {font-family:Verdana;  color:black; font-weight:regular; font-size:11; border-width:1px; border-color:black}

a.Links { font-family:Verdana;  color:white; text-decoration:none; font-size:11}
a.Links:hover {text-decoration:underline}

.TN  {font-family:Verdana;  color:white; text-decoration:none; font-weight:bold; font-size:13}
.TN:hover {color:orange}

.TNA  {font-family:Verdana;  color:red; text-decoration:none; font-weight:bold; font-size:11}
.TNA:hover {text-decoration:underline}

.HeaderClass  {font-family:Verdana;  color:black;font-weight:bold; font-size:12}
.TableHead  {font-family:Verdana;  color:white; font-weight:bold; font-size:10; background-color:#A0410D}
.BlackText {font-family:Verdana;  color:black;font-weight:regular; font-size:11}

.BlackLink  {font-family:Verdana;  color:black; text-decoration:none; font-weight:bold; font-size:11; text-decoration:none}
a.BlackLink:hover {text-decoration:underline}

.GreenLink  {font-family:Verdana;  color:green; text-decoration:none; font-weight:bold; font-size:11; text-decoration:none}
a.GreenLink:hover {text-decoration:underline}

.TN2  {font-family:Verdana;  color:993333; text-decoration:none; font-weight:bold; font-size:11}
.TN2:hover {color:#993300}

.Pres {color:red}
.SRT {background-color:#993333; border-width:1px; border-color:black; font-family:Arial; font-size:11; font-weight:bold; color:white; }
  </style>
  </head>
  <body onload=document.jsl.uname.focus()><center>
  <span class=HeaderClass>JobSeekers  Login  </span>
  <p class=BlackLink>You must log in to access this area of the site.</p>
  <p><form name=jsl method="post" action="<?=$PHP_SELF?>">
<table class=BlackLink>
<tr>
	<td align=right>Username:</td>
	<td align=right> <input type="text" name="uname" size="8" style="border-color:black"></td>
</tr>

<tr>
	<td align=right>Password:</td>
	<td align=right><input type="password" name="upass" SIZE="8" style="border-color:black"></td>
</tr>

<tr>
	<td colspan=2 align=right>
	<input type=hidden name=job_id value=<?=$job_id?>>
	<input type="submit" value=" Login " style="border-width:2; border-color:black; font-family:verdana; font-weight:bold; color:#336699; background-color:white"></td>
</tr>

<tr><td colspan=2 align=center> <a class=TN href="javascript:window.opener.location('forgot.php');window.close();"> Forgot your username/password? </a></td></tr>

</table>
  </form></p>
  </center>
  </body>
  </html>
  <?php
  exit;
}



session_register("uname");
session_register("upass");


$sql = "SELECT * FROM job_seeker_info WHERE
        uname = '$uname' AND upass = '$upass'";
$result = mysql_query($sql);
if (!$result)
{
  error("A database error occurred while checking your ".
        "login details.\\nIf this error persists, please ".
        "contact webmaster@$_SERVER[HTTP_HOST]");
}

elseif (mysql_num_rows($result) == 0) {
  session_unregister("uname");
  session_unregister("upass");
  ?>
  <html>
  <head>
  <title> Access Denied </title><meta dcb license 123456789>
  </head>
  <body>
  <font face=verdana>
  <h1> Access Denied </h1>
  <p>Your user ID or password is incorrect, or you are not a
     registered user on this site.<br><br> To try logging in again, click
     <a href="<?=$PHP_SELF?>">here</a>. <br><br>To register for instant
     access, click <a href="jobseeker_registration.php">here</a>.</p>
  </body>
  </html>
  <?php
  exit;
}

?>